package vikaa.timelinepackage;

import vikaa.wowo.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class GalleryManagerView extends LinearLayout
{
    private LinearLayout m_gallerychild;
    
    private ImageView m_selectframe;
    private LinearLayout m_container;
    
    private LayoutInflater m_inflater;
    
    
    public GalleryManagerView(Context context)
    {
        super(context);
        
        m_inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        m_gallerychild = (LinearLayout)m_inflater.inflate(R.layout.gallery_manager_item, null);
        
        //m_selectframe = (ImageView)m_gallerychild.findViewById(R.id.selectedframe);
        m_container = (LinearLayout)m_gallerychild.findViewById(R.id.container);
        
        
        setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, 
            ViewGroup.LayoutParams.WRAP_CONTENT));
    }

    public void setContentView(View contentview)
    {
        setContentView(contentview, null);
    }
    
    public void setContentView(View contentview, ViewGroup.LayoutParams params)
    {
        m_container.addView(contentview, m_container.getLayoutParams().width, m_container.getLayoutParams().height);
        
        /*int width = 116;
        if (null != params)
        {
            width = params.width;
            m_container.getLayoutParams().width = params.width - 20;
        }*/
        
        addView(m_gallerychild);
    }
    
    @Override
    public void setSelected(boolean isSelected)
    {
        //m_selectframe.setVisibility(isSelected ? VISIBLE : INVISIBLE);
    }
    
}
